package edu.sysu.cshare.dao;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="T_MESSAGE")
public class Message {
	public Message(){
		
	}
	private String category;
	private List<Comment> comments = new ArrayList<Comment>();
	private String content;
	private Calendar createDate;
	private long id;
	private User publisher;
	private String title;
	
	public String getCategory() {
		return category;
	}
	@OneToMany(mappedBy="message")
	public List<Comment> getComments() {
		return comments;
	}

	public String getContent() {
		return content;
	}
	public Calendar getCreateDate() {
		return createDate;
	}
	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}
	@ManyToOne
	public User getPublisher() {
		return publisher;
	}
	public String getTitle() {
		return title;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public void setCreateDate(Calendar createDate) {
		this.createDate = createDate;
	}
	public void setId(long id) {
		this.id = id;
	}
	public void setPublisher(User publisher) {
		this.publisher = publisher;
	}
	public void setTitle(String title) {
		this.title = title;
	}
}
